package composite;

public class Main {
	public static void main(String[] args){
		try{
			System.out.println("Making root entryes...");
			Directory rootdir = new Directory("root");
			Directory bindir = new Directory("bin");
			Directory tmpdir = new Directory("tmp");
			Directory usrdir = new Directory("usr");
			rootdir.add(bindir);
			rootdir.add(tmpdir);
			rootdir.add(usrdir);
			bindir.add(new File("vi", 10000));
			bindir.add(new File("latex", 20000));

			rootdir.printList();

			System.out.println("");
			System.out.println("Making user entries...");
			Directory hoge = new Directory("hoge");
			Directory piyo = new Directory("piyo");
			Directory moga = new Directory("moga");
			usrdir.add(hoge);
			usrdir.add(piyo);
			usrdir.add(moga);

			hoge.add(new File("dialy.html", 100));
			hoge.add(new File("Composite.java", 200));
			piyo.add(new File("memo.tex", 300));
			moga.add(new File("game.doc", 400));
			moga.add(new File("junk.mail", 500));

			rootdir.printList();

		}catch (FileTreatmentException e){
			e.printStackTrace();
		}
	}
}
